home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / RAVESystem.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  15.1 KB  |  435 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        RAVESystem.p
  3.  
  4.      Contains:    Interfaces needed when building RAVE engines                            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT RAVESystem;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __RAVESYSTEM__}
  27. {$SETC __RAVESYSTEM__ := 1}
  28.  
  29. {$I+}
  30. {$SETC RAVESystemIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __CONDITIONALMACROS__}
  34. {$I ConditionalMacros.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __RAVE__}
  37. {$I RAVE.p}
  38. {$ENDC}
  39.  
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN POWER}
  44. {$LibExport+}
  45.  
  46.  
  47. {***********************************************************************************************
  48.  *
  49.  * Typedefs of texture/bitmap method functions provided by the drawing engine.
  50.  *
  51.  **********************************************************************************************}
  52. { TQAColorTableNew    parameter descriptions }
  53. { TQAColorTableType    pixelType            Depth, color space, etc. }
  54. { void                    *pixelData            lookup table entries in pixelType format }
  55. { long                    transparentIndex    boolean, false means no transparency, true means index 0 is transparent }
  56. { TQAColorTable        **newTable            (Out) Newly created TQAColorTable }
  57.  
  58. TYPE
  59. {$IFC TYPED_FUNCTION_POINTERS}
  60.     TQAColorTableNew = FUNCTION(pixelType: TQAColorTableType; pixelData: UNIV Ptr; transparentIndex: LONGINT; VAR newTable: TQAColorTablePtr): TQAError; C;
  61. {$ELSEC}
  62.     TQAColorTableNew = ProcPtr;
  63. {$ENDC}
  64.  
  65. { TQAColorTableDelete    parameter descriptions }
  66. { TQAColorTable        *colorTable        Previously allocated by QAColorTableNew() }
  67. {$IFC TYPED_FUNCTION_POINTERS}
  68.     TQAColorTableDelete = PROCEDURE(VAR colorTable: TQAColorTable); C;
  69. {$ELSEC}
  70.     TQAColorTableDelete = ProcPtr;
  71. {$ENDC}
  72.  
  73. { TQATextureNew    parameter descriptions }
  74. {    unsigned long        flags                Mask of kQATexture_xxx flags }
  75. {    TQAImagePixelType    pixelType            Depth, color space, etc. }
  76. {    const TQAImage        images[]            Image(s) for texture }
  77. {    TQATexture            **newTexture        (Out) Newly created TQATexture, or NULL on error }
  78. {$IFC TYPED_FUNCTION_POINTERS}
  79.     TQATextureNew = FUNCTION(flags: UInt32; pixelType: TQAImagePixelType; {CONST}VAR images: TQAImage; VAR newTexture: TQATexturePtr): TQAError; C;
  80. {$ELSEC}
  81.     TQATextureNew = ProcPtr;
  82. {$ENDC}
  83.  
  84. { TQATextureDetach    parameter descriptions }
  85. {    TQATexture            *texture            Previously allocated by QATextureNew() }
  86. {$IFC TYPED_FUNCTION_POINTERS}
  87.     TQATextureDetach = FUNCTION(VAR texture: TQATexture): TQAError; C;
  88. {$ELSEC}
  89.     TQATextureDetach = ProcPtr;
  90. {$ENDC}
  91.  
  92. { TQATextureDelete    parameter descriptions }
  93. {    TQATexture            *texture            Previously allocated by QATextureNew() }
  94. {$IFC TYPED_FUNCTION_POINTERS}
  95.     TQATextureDelete = PROCEDURE(VAR texture: TQATexture); C;
  96. {$ELSEC}
  97.     TQATextureDelete = ProcPtr;
  98. {$ENDC}
  99.  
  100. { TQATextureBindColorTable    parameter descriptions }
  101. {    TQATexture            *texture            Previously allocated by QATextureNew() }
  102. {    TQAColorTable        *colorTable            Previously allocated by QAColorTableNew() }
  103. {$IFC TYPED_FUNCTION_POINTERS}
  104.     TQATextureBindColorTable = FUNCTION(VAR texture: TQATexture; VAR colorTable: TQAColorTable): TQAError; C;
  105. {$ELSEC}
  106.     TQATextureBindColorTable = ProcPtr;
  107. {$ENDC}
  108.  
  109. { TQABitmapNew    parameter descriptions }
  110. {    unsigned long        flags                Mask of kQABitmap_xxx flags }
  111. {    TQAImagePixelType    pixelType            Depth, color space, etc. }
  112. {    const TQAImage        *image                Image }
  113. {    TQABitmap            **newBitmap            (Out) Newly created TQABitmap, or NULL on error }
  114. {$IFC TYPED_FUNCTION_POINTERS}
  115.     TQABitmapNew = FUNCTION(flags: UInt32; pixelType: TQAImagePixelType; {CONST}VAR image: TQAImage; VAR newBitmap: TQABitmapPtr): TQAError; C;
  116. {$ELSEC}
  117.     TQABitmapNew = ProcPtr;
  118. {$ENDC}
  119.  
  120. { TQABitmapDetach    parameter descriptions }
  121. {    TQABitmap            *bitmap            Previously allocated by QABitmapNew() }
  122. {$IFC TYPED_FUNCTION_POINTERS}
  123.     TQABitmapDetach = FUNCTION(VAR bitmap: TQABitmap): TQAError; C;
  124. {$ELSEC}
  125.     TQABitmapDetach = ProcPtr;
  126. {$ENDC}
  127.  
  128. { TQABitmapDelete    parameter descriptions }
  129. {    TQABitmap            *bitmap            Previously allocated by QABitmapNew() }
  130. {$IFC TYPED_FUNCTION_POINTERS}
  131.     TQABitmapDelete = PROCEDURE(VAR bitmap: TQABitmap); C;
  132. {$ELSEC}
  133.     TQABitmapDelete = ProcPtr;
  134. {$ENDC}
  135.  
  136. { TQABitmapBindColorTable    parameter descriptions }
  137. {    TQABitmap            *bitmap            Previously allocated by QABitmapNew() }
  138. {    TQAColorTable        *colorTable        Previously allocated by QAColorTableNew() }
  139. {$IFC TYPED_FUNCTION_POINTERS}
  140.     TQABitmapBindColorTable = FUNCTION(VAR bitmap: TQABitmap; VAR colorTable: TQAColorTable): TQAError; C;
  141. {$ELSEC}
  142.     TQABitmapBindColorTable = ProcPtr;
  143. {$ENDC}
  144.  
  145. {***********************************************************************************************
  146.  *
  147.  * Typedefs of private (system-only) functions provided by the drawing engine.
  148.  *
  149.  * The TQADrawPrivateNew function returns a TQADrawPrivate *, which points to the
  150.  * engine-specific private data created for the context. (TQADrawPrivate is a dummy
  151.  * type which is then cast to the correct engine-specific datatype by the engine code.)
  152.  *
  153.  * The TQADrawPrivateDelete function deletes the engine-specific private data.
  154.  *
  155.  * TQAStorePrivateNew and TQAStorePrivateDelete provide the same function as QADrawPrivateNew
  156.  * and TQADrawPrivateDelete, but for the texture and bitmap storage context.
  157.  *
  158.  * TQADrawMethodGet and TQAStoreMethodGet are called by the RAVE manager to retrieve
  159.  * the method pointers for a drawing engine.
  160.  *
  161.  * The TQAEngineCheckDevice function returns TRUE if the engine can render to the
  162.  * indicated GDevice.
  163.  *
  164.  **********************************************************************************************}
  165. { TQADrawPrivateNew    parameter descriptions }
  166. {    TQADrawContext        *newDrawContext        Draw context to initialize }
  167. {    const TQADevice        *device                Target device }
  168. {    const TQARect        *rect                Target rectangle (device coordinates) }
  169. {    const TQAClip        *clip                2D clip region (or NULL) }
  170. {    unsigned long        flags                Mask of kQAContext_xxx }
  171. {$IFC TYPED_FUNCTION_POINTERS}
  172.     TQADrawPrivateNew = FUNCTION(VAR newDrawContext: TQADrawContext; {CONST}VAR device: TQADevice; {CONST}VAR rect: TQARect; {CONST}VAR clip: TQAClip; flags: UInt32): TQAError; C;
  173. {$ELSEC}
  174.     TQADrawPrivateNew = ProcPtr;
  175. {$ENDC}
  176.  
  177. { TQADrawPrivateDelete    parameter descriptions }
  178. {    TQADrawPrivate        *drawPrivate        Private context data to delete }
  179. {$IFC TYPED_FUNCTION_POINTERS}
  180.     TQADrawPrivateDelete = PROCEDURE(VAR drawPrivate: TQADrawPrivate); C;
  181. {$ELSEC}
  182.     TQADrawPrivateDelete = ProcPtr;
  183. {$ENDC}
  184.  
  185. { TQAEngineCheckDevice    parameter descriptions }
  186. {    const TQADevice        *device            Target device }
  187. {$IFC TYPED_FUNCTION_POINTERS}
  188.     TQAEngineCheckDevice = FUNCTION({CONST}VAR device: TQADevice): TQAError; C;
  189. {$ELSEC}
  190.     TQAEngineCheckDevice = ProcPtr;
  191. {$ENDC}
  192.  
  193. { TQAEngineGestalt    parameter descriptions }
  194. {    TQAGestaltSelector    selector            Gestalt parameter being requested }
  195. {    void                *response            Buffer that receives response }
  196. {$IFC TYPED_FUNCTION_POINTERS}
  197.     TQAEngineGestalt = FUNCTION(selector: TQAGestaltSelector; response: UNIV Ptr): TQAError; C;
  198. {$ELSEC}
  199.     TQAEngineGestalt = ProcPtr;
  200. {$ENDC}
  201.  
  202. {***********************************************************************************************
  203.  *
  204.  * The TQAEngineMethod union is used to represent a single engine method (it's a
  205.  * parameter to QAEngineGetMethod). TQAEngineMethodTag identifies which method is being
  206.  * requested.
  207.  *
  208.  **********************************************************************************************}
  209.     TQAEngineMethodPtr = ^TQAEngineMethod;
  210.     TQAEngineMethod = RECORD
  211.         CASE INTEGER OF
  212.         0: (
  213.             drawPrivateNew:        TQADrawPrivateNew;                        {  Method: Create a private draw context  }
  214.             );
  215.         1: (
  216.             drawPrivateDelete:    TQADrawPrivateDelete;                    {  Method: Delete a private draw context  }
  217.             );
  218.         2: (
  219.             engineCheckDevice:    TQAEngineCheckDevice;                    {  Method: Check a device for drawing  }
  220.             );
  221.         3: (
  222.             engineGestalt:        TQAEngineGestalt;                        {  Method: Gestalt  }
  223.             );
  224.         4: (
  225.             textureNew:            TQATextureNew;                            {  Method: Create a texture (load is non-blocking)  }
  226.             );
  227.         5: (
  228.             textureDetach:        TQATextureDetach;                        {  Method: Complete load of a texture (blocking)  }
  229.             );
  230.         6: (
  231.             textureDelete:        TQATextureDelete;                        {  Method: Delete a texture  }
  232.             );
  233.         7: (
  234.             bitmapNew:            TQABitmapNew;                            {  Method: Create a bitmap (load is non-blocking)   }
  235.             );
  236.         8: (
  237.             bitmapDetach:        TQABitmapDetach;                        {  Method: Complete load of a bitmap (blocking)  }
  238.             );
  239.         9: (
  240.             bitmapDelete:        TQABitmapDelete;                        {  Method: Delete a bitmap  }
  241.             );
  242.         10: (
  243.             colorTableNew:        TQAColorTableNew;                        {  Method: Create a new color table  }
  244.             );
  245.         11: (
  246.             colorTableDelete:    TQAColorTableDelete;                    {  Method: Create a new color table  }
  247.             );
  248.         12: (
  249.             textureBindColorTable: TQATextureBindColorTable;            {  Method: Bind a CLUT to a texture  }
  250.             );
  251.         13: (
  252.             bitmapBindColorTable: TQABitmapBindColorTable;                {  Method: Bind a CLUT to a bitmap  }
  253.             );
  254.     END;
  255.  
  256.     TQAEngineMethodTag             = LONGINT;
  257. CONST
  258.     kQADrawPrivateNew            = {TQAEngineMethodTag}0;
  259.     kQADrawPrivateDelete        = {TQAEngineMethodTag}1;
  260.     kQAEngineCheckDevice        = {TQAEngineMethodTag}2;
  261.     kQAEngineGestalt            = {TQAEngineMethodTag}3;
  262.     kQATextureNew                = {TQAEngineMethodTag}4;
  263.     kQATextureDetach            = {TQAEngineMethodTag}5;
  264.     kQATextureDelete            = {TQAEngineMethodTag}6;
  265.     kQABitmapNew                = {TQAEngineMethodTag}7;
  266.     kQABitmapDetach                = {TQAEngineMethodTag}8;
  267.     kQABitmapDelete                = {TQAEngineMethodTag}9;
  268.     kQAColorTableNew            = {TQAEngineMethodTag}10;
  269.     kQAColorTableDelete            = {TQAEngineMethodTag}11;
  270.     kQATextureBindColorTable    = {TQAEngineMethodTag}12;
  271.     kQABitmapBindColorTable        = {TQAEngineMethodTag}13;
  272.  
  273. {***********************************************************************************************
  274.  *
  275.  * QARegisterEngine() registers a new engine. This is called at boot time by the drawing engine
  276.  * initialization code to register itself with the system. This call takes only one parameter,
  277.  * the engine's function that allows the manager to request the other methods.
  278.  *
  279.  **********************************************************************************************}
  280. { TQAEngineGetMethod    parameter descriptions }
  281. {    TQAEngineMethodTag        methodTag                Method being requested }
  282. {    TQAEngineMethod            *method                    (Out) Method }
  283.  
  284. TYPE
  285. {$IFC TYPED_FUNCTION_POINTERS}
  286.     TQAEngineGetMethod = FUNCTION(methodTag: TQAEngineMethodTag; VAR method: TQAEngineMethod): TQAError; C;
  287. {$ELSEC}
  288.     TQAEngineGetMethod = ProcPtr;
  289. {$ENDC}
  290.  
  291. { QARegisterEngine    parameter descriptions }
  292. {    TQAEngineGetMethod        engineGetMethod        Engine's getMethod method }
  293. FUNCTION QARegisterEngine(engineGetMethod: TQAEngineGetMethod): TQAError; C;
  294. {***********************************************************************************************
  295.  *
  296.  * The TQADrawMethod union is used to represent a single draw context method (it's a
  297.  * parameter to QARegisterDrawMethod). TQADrawMethodTag identifies which method is being
  298.  * passed.
  299.  *
  300.  **********************************************************************************************}
  301.  
  302. TYPE
  303.     TQADrawMethodPtr = ^TQADrawMethod;
  304.     TQADrawMethod = RECORD
  305.         CASE INTEGER OF
  306.         0: (
  307.             setFloat:            TQASetFloat;                            {  Method: Set a float state variable  }
  308.             );
  309.         1: (
  310.             setInt:                TQASetInt;                                {  Method: Set an unsigned long state variable  }
  311.             );
  312.         2: (
  313.             setPtr:                TQASetPtr;                                {  Method: Set an unsigned long state variable  }
  314.             );
  315.         3: (
  316.             getFloat:            TQAGetFloat;                            {  Method: Get a float state variable  }
  317.             );
  318.         4: (
  319.             getInt:                TQAGetInt;                                {  Method: Get an unsigned long state variable  }
  320.             );
  321.         5: (
  322.             getPtr:                TQAGetPtr;                                {  Method: Get an pointer state variable  }
  323.             );
  324.         6: (
  325.             drawPoint:            TQADrawPoint;                            {  Method: Draw a point  }
  326.             );
  327.         7: (
  328.             drawLine:            TQADrawLine;                            {  Method: Draw a line  }
  329.             );
  330.         8: (
  331.             drawTriGouraud:        TQADrawTriGouraud;                        {  Method: Draw a Gouraud shaded triangle  }
  332.             );
  333.         9: (
  334.             drawTriTexture:        TQADrawTriTexture;                        {  Method: Draw a texture mapped triangle  }
  335.             );
  336.         10: (
  337.             drawVGouraud:        TQADrawVGouraud;                        {  Method: Draw Gouraud vertices  }
  338.             );
  339.         11: (
  340.             drawVTexture:        TQADrawVTexture;                        {  Method: Draw texture vertices  }
  341.             );
  342.         12: (
  343.             drawBitmap:            TQADrawBitmap;                            {  Method: Draw a bitmap  }
  344.             );
  345.         13: (
  346.             renderStart:        TQARenderStart;                            {  Method: Initialize for rendering  }
  347.             );
  348.         14: (
  349.             renderEnd:            TQARenderEnd;                            {  Method: Complete rendering and display  }
  350.             );
  351.         15: (
  352.             renderAbort:        TQARenderAbort;                            {  Method: Abort any outstanding rendering (blocking)  }
  353.             );
  354.         16: (
  355.             flush:                TQAFlush;                                {  Method: Start render of any queued commands (non-blocking)  }
  356.             );
  357.         17: (
  358.             sync:                TQASync;                                {  Method: Wait for completion of all rendering (blocking)  }
  359.             );
  360.         18: (
  361.             submitVerticesGouraud: TQASubmitVerticesGouraud;            {  Method: Submit Gouraud vertices for trimesh  }
  362.             );
  363.         19: (
  364.             submitVerticesTexture: TQASubmitVerticesTexture;            {  Method: Submit Texture vertices for trimesh  }
  365.             );
  366.         20: (
  367.             drawTriMeshGouraud:    TQADrawTriMeshGouraud;                    {  Method: Draw a Gouraud triangle mesh  }
  368.             );
  369.         21: (
  370.             drawTriMeshTexture:    TQADrawTriMeshTexture;                    {  Method: Draw a Texture triangle mesh  }
  371.             );
  372.         22: (
  373.             setNoticeMethod:    TQASetNoticeMethod;                        {  Method: Set a notice method  }
  374.             );
  375.         23: (
  376.             getNoticeMethod:    TQAGetNoticeMethod;                        {  Method: Get a notice method  }
  377.             );
  378.     END;
  379.  
  380.     TQADrawMethodTag             = LONGINT;
  381. CONST
  382.     kQASetFloat                    = {TQADrawMethodTag}0;
  383.     kQASetInt                    = {TQADrawMethodTag}1;
  384.     kQASetPtr                    = {TQADrawMethodTag}2;
  385.     kQAGetFloat                    = {TQADrawMethodTag}3;
  386.     kQAGetInt                    = {TQADrawMethodTag}4;
  387.     kQAGetPtr                    = {TQADrawMethodTag}5;
  388.     kQADrawPoint                = {TQADrawMethodTag}6;
  389.     kQADrawLine                    = {TQADrawMethodTag}7;
  390.     kQADrawTriGouraud            = {TQADrawMethodTag}8;
  391.     kQADrawTriTexture            = {TQADrawMethodTag}9;
  392.     kQADrawVGouraud                = {TQADrawMethodTag}10;
  393.     kQADrawVTexture                = {TQADrawMethodTag}11;
  394.     kQADrawBitmap                = {TQADrawMethodTag}12;
  395.     kQARenderStart                = {TQADrawMethodTag}13;
  396.     kQARenderEnd                = {TQADrawMethodTag}14;
  397.     kQARenderAbort                = {TQADrawMethodTag}15;
  398.     kQAFlush                    = {TQADrawMethodTag}16;
  399.     kQASync                        = {TQADrawMethodTag}17;
  400.     kQASubmitVerticesGouraud    = {TQADrawMethodTag}18;
  401.     kQASubmitVerticesTexture    = {TQADrawMethodTag}19;
  402.     kQADrawTriMeshGouraud        = {TQADrawMethodTag}20;
  403.     kQADrawTriMeshTexture        = {TQADrawMethodTag}21;
  404.     kQASetNoticeMethod            = {TQADrawMethodTag}22;
  405.     kQAGetNoticeMethod            = {TQADrawMethodTag}23;
  406.  
  407. {***********************************************************************************************
  408.  *
  409.  * System call to register a new method for an engine. This is called during the engine's
  410.  * draw private new functions (to set the initial value of the draw methods), and possibly
  411.  * at other times when the engine needs to change a draw method.
  412.  *
  413.  **********************************************************************************************}
  414. { QARegisterDrawMethod    parameter descriptions }
  415. {    TQADrawContext            *drawContext            Draw context in which to set method }
  416. {    TQADrawMethodTag        methodTag                Method to set }
  417. {    TQADrawMethod            method                    Method }
  418. FUNCTION QARegisterDrawMethod(VAR drawContext: TQADrawContext; methodTag: TQADrawMethodTag; method: TQADrawMethod): TQAError; C;
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425. {$ALIGN RESET}
  426. {$POP}
  427.  
  428. {$SETC UsingIncludes := RAVESystemIncludes}
  429.  
  430. {$ENDC} {__RAVESYSTEM__}
  431.  
  432. {$IFC NOT UsingIncludes}
  433.  END.
  434. {$ENDC}
  435.